TsgDWGImage
Unit: DWG
Description
The main TsgDWGImage
class is a descendant of TsgCADImage
(which is a descendant of TGraphic
) and overrides its methods. TsgDWGImage
can be used in the TImage
control for displaying and navigation AutoCAD™ DWG drawings.
Learn more about DWG
DWG is a widely used file format for exchanging 2D and 3D CAD data. It's not an open format but owned by AutoDesk Inc. who used it for their program AutoCAD™. With every new version of AutoCAD the definition of DWG is changed but nevertheless there are many of programs which are capable of reading and writing some form of DWG. After loading a DWG file, its separate DWG/DXF entities are accessible through the Converter property and its indexed properties Blocks and Entities. All entities are descendants of TsgDXFEntity. For example, the TEXT entity has TsgDXFText type, etc. In other words, the entities are common for both DXF and DWG.
Syntax
TsgDWGImage = class(TsgCADImage)
Properties
Properties | Description |
---|---|
Preview | The property contains the bitmap for the DWG image preview. |
Properties derived from TsgCADImage | Description |
---|---|
BackgroundColor | The property specifies the background color of the drawing which TsgCADImage displays. |
Blocks | The property lists the blocks references of the drawing. |
BorderSize | The property specifies the size of the drawing’s border in global points or ratio. |
BorderType | The property sets the type of drawing’s border. |
CachingRasterMode | The property specifies the size of drawing’s border in global points or ratio. |
CBFormat | The property displays predefined clipboard format. |
ColorToLineWeight | The property specifies the line weight for entities by colors. |
Converter | The property contains information about the loaded CAD file. |
CurrentLayout | The property sets the current layout. |
DefaultColor | The property sets the color for elements which have white color in AutoCAD™ DXF/DWG |
DimensionsVisible | The property switches on or off dimension of the drawing. |
DrawingBox | The property defines drawing box. |
DrawMatrix | The property gets the matrix used for drawing. |
DrawMode | The property specifies the current color mode. |
Entities | The property lists all the entities of the CAD file. |
Extents | The property defines drawing's extents. |
FileName | The property gets and sets the name of the file from which the image is loaded. |
IsDraw3DAxes | The property gets and sets 3Daxes drawing mode. |
IsDrawingRotated | The property defines if the drawing is rotated. |
IsLoading | The property defines if the drawing is loading. |
IsPlotting | The property defines the destination source status. |
IsProcessMessages | The property defines the messages processing mode. |
IsShowBackground | The property can be used to show background. |
IsShowLineWeight | The property can be used to draw all entities with NullWidth pixel lineweights. |
IsWithoutBorder | The property can be used to draw the drawing without adding the empty space (borders). |
Layouts | The property gets the indexed layout. |
LayoutsCount | The property gets the number of layouts. |
LineWeightScale | The property gets and sets the line weight scale. |
Millimeters | The property can be used to change the drawing units (millimeters/inches) |
NullWidth | The property specifies the default line weight of entities with zero lineweight. |
OwnSource | The property indicates if data is loaded. |
PureExtents | The property defines the exact image field in world coordinates, with no empty space added. |
ResizeDisproportionateDrawing | The property points to layer, containing given primitive if this layer is given. |
Scale | The property returns scale factor of the image as TFPoint structure. |
ShowImages | The property gets and sets the raster image drawing mode. |
Stretch | The property indicates whether the CAD drawing should be changed so that it exactly fits the bounds of the image control. |
TextVisible | The property switches on or off texts of the CAD image. |
TTFMode | The property specifies the mode of the TTF fonts reflection. |
UseWinEllipse | The property can be used for drawing most of the arcs and circles in the image using GDI Windows functions such as Ellipse, Arc, etc., not linearized. |
ViewRectangle | For CAD Import VCL internal uses only. |
Methods
Methods | Description |
---|---|
Assign | The method copies a CAD image object and increase reference to the Converter object. |
LoadFromStream | The method loads a CAD image from stream. |
LoadPreviewFromFile | The method loads the preview. |
SaveToStream | The method saves the image to the stream. |
Methods derived from TsgCADImage | Description |
---|---|
AbsHeight | The method returns the entire height of the CAD image. |
AbsWidth | The method returns the entire width of the CAD image. |
AddScaledDXF | The method adds a new drawing to the TsgCADImage object. |
AddScaledDXFEx | The method adds a new drawing to the TsgCADImage object. |
CommonToInternalUnits | The method converts CAD coordinates of an image to the coordinates of the inner drawing's coordinate system. |
Create | Creates and initializes a new TsgCADImage object. |
Destroy | Destroys an instance of the TsgCADImage class. |
DrawRect | The method renders a part of a loaded drawing on a device context specified by DC. |
ExportToMetafile | The method exports a CAD drawing to a Windows Enhanced metafile |
GetCADCoords | The method returns coordinates of a point on a drawing. |
GetEntityColor | The method returns the entity's color. |
GetExtents | The method recalculates the drawing extents. |
GetObjectSnapMask | The method returns the object snap mode. |
GetPoint | The method converts point from the 3D coordinate system to the 2D coordinate system. |
GetPointUCS | The method converts the UCS coordinates to the screen coordinates. |
GetRealImagePoint | The method the real coordinates of the point. |
GetSnapData | The method returns the data structure that contains the closest entity to the argument point, and the node point. |
GetVisibleArea | The method returns the visible area. |
InternalToCommonUnits | The method converts the coordinates of the inner drawing's coordinate system to the CAD coordinates of an image. |
LoadFromClipboardFormat | The method loads from clipboard. |
LoadFromFile | The method loads a CAD image from file. |
Measurement | The method returns the information about measurement system for linear and angular measures. |
RefreshCurrentLayout | The method refreshes sizes of the current layout. |
ResetDrawingBox | The method switches off the drawing box. |
Rotate | The method rotates the current image. |
RotDefault | The method rotates the image to the default view. |
RotToView | The method rotates the image by parameter defined in A3DView. |
SaveToClipboardFormat | The method saves to clipboard. |
SaveToFile | The method saves the image to the file. |
SetObjectSnapMask | The method sets the object snap mode. |
SetVisibleArea | The method sets an area for snap. |
StopLoading | The method stops loading the file and displays only the loaded data. |
Events
Events derived from TsgCADImage | Description |
---|---|
OnAfterRotate | The event occurs after a CAD image being rotated. |
OnBeforeRotate | The event occurs before a CAD image being rotated. |
OnLayoutChange | The event occurs when a current layout is being changed. |
Types
Types | Description |
---|---|
TdwgVersion |
Variables and constants
Variables and constants | Description |
---|---|
CF_DWG | Predefined clipboard format for use in the LoadFromClipboardFormat method. |